package eu.tamariba.html.client.managed.ui;

import com.google.gwt.requestfactory.ui.client.ProxyRenderer;
import eu.tamariba.html.client.managed.request.ResourceProxy;
import eu.tamariba.html.shared.ResourceType;

public class ResourceProxyRenderer extends ProxyRenderer<ResourceProxy> {

    private static eu.tamariba.html.client.managed.ui.ResourceProxyRenderer INSTANCE;

    protected ResourceProxyRenderer() {
        super(new String[] { "uri" });
    }

    public static eu.tamariba.html.client.managed.ui.ResourceProxyRenderer instance() {
        if (INSTANCE == null) {
            INSTANCE = new ResourceProxyRenderer();
        }
        return INSTANCE;
    }

    public String render(ResourceProxy object) {
        if (object == null) {
            return "";
        }
        return object.getUri() + " (" + object.getId() + ")";
    }
}
